package com.oo.packaging_2.book;

/**
 * Book--${description}
 *
 * @author: Jovi
 * @createTime: 2017-04-19 15:11
 **/
public class Book {

    private String name;

    private String author;

    private String publisher;

    private int price;

    public String getName() {
        return name;
    }

    public String getAuthor() {
        return author;
    }


    public String getPublisher() {
        return publisher;
    }

    public void setPublisher(String publisher) {
        this.publisher = publisher;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        if (price < 10) {
            System.out.println("价格必须不小于10");
        }else
        this.price = price;
    }

    public Book(String name, String author) {
        this.name = name;
        this.author = author;
    }

    public Book() {
    }

    public void intro() {
        System.out.println("书名："+getName()+"\n作者："
                +getAuthor()+"\n出版社："+getPublisher()+"\n价格："+getPrice());

    }
}
